package com.shopping.auth.feign;

import com.shopping.auth.feign.factory.UserFeignFactory;
import com.shopping.common.entity.vo.UserVo;
import com.shopping.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(contextId = "userLoginFeign",name = "system",path = "/user",fallbackFactory = UserFeignFactory.class)
public interface UserFeign {

    /**
     * 查找用户
     * @param username
     * @return
     */
    @PostMapping("/findUserByUsername/{username}")
    public Result<UserVo> findUserByUsername(@PathVariable String username);

    /**
     * 添加用户
     * @param userVo
     * @return
     */
    @PostMapping("/addUser")
    Result<String> addUser(@RequestBody UserVo userVo);
}
